



import 'dart:io';

extension AssetsExt on String {
  String get img => 'assets/$this.png';
}

extension StringExt on String {
  String removeSuffix(String suffix) {
    if (endsWith(suffix)) {
      return substring(0, length - suffix.length);
    }
    return this;
  }

  String removeSurrounding(String prefix, String suffix) {
    if (startsWith(prefix) && endsWith(suffix)) {
      return substring(prefix.length, length - suffix.length);
    }
    return this;
  }


}

/// 判断是否为空字符串
bool kIsEmptyString(dynamic str) {
  if (str == "" || str == null || str == 'null' || str == 'undefined') {
    return true;
  } else {
    return false;
  }
}

/// 获取百度地图ak
Future<String> kGetBbfAk() async {
  String ak = '';
  if (Platform.isIOS) {
    ak = 'b543YGG0ZCBjTTXtdGhk6O0xiJORJWeP';
  } else if (Platform.isAndroid) {
    ak = '';
  } else if (Platform.operatingSystem == 'ohos') {
    ak = '';
  }
  return ak;
}

